{extend name="platform/base" /}
{block name="resources"}
<!-- <link rel="stylesheet" type="text/css" href="ADMIN_CSS/haidao.css"> -->
<!-- <link rel="stylesheet" type="text/css" href="ADMIN_CSS/admin.css"> -->
<style>
.btn-test{
	font-family: "microsoft yahei";
	border-radius: 4px;
	padding: 5px 20px;
	background-color: #51A351;
	color: #FFF;
	margin: 0 10px;
	border: none;
}
.table-logo{display:inline-block;width:75px;float:left;}
.table-pay{display:inline-block;width:590px;overflow:hidden;margin-top: 7px;}
.table-desc{display:inline-block;width:590px;overflow:hidden;}
.table tr {
    font-size: 12px;
}
</style>
{/block}
{block name="main"}
<!-- 邮箱设置 -->
<div class="set-style">
	<div class="tab-pane active">
		<table class="table table-striped table-main" border="0">
			<colgroup>
				<col width="70%">
				<col width="15%">
				<col width="15%">
			</colgroup>
			<tbody>
				<tr class="table-title" style="background: white;z-index: 10;border: 1px solid #E3E3E3;">
					<th class="tal">第三方登录</th>
					<th style="text-align: center;">状态</th>
					<th style="text-align: center;">操作</th>
				</tr>
			</tbody>
			<tbody>
					<tr>
					     <td>
					         <div class="table-logo"><img src="__PUBLIC__admin/images/wchat.png"></div>
					         <span class="table-pay">微信登录</span>
					         <span class="table-desc"></span> 
					     </td>
					     {if condition="$wchat_config.is_use eq 1"}
					     	<td style="text-align: center;line-height:59px;"><a href="javascript:;" class="pay-start" status =1 onclick="set_status('WCHAT', this)"><img src="__ROOT__/public/admin/images/start.png" /></a></td>
					     {else/}
					     	<td style="text-align: center;line-height:59px;"><a href="javascript:;" class="pay-close" status =0 onclick="set_status('WCHAT', this)"><img src="__ROOT__/public/admin/images/close.png" /></a></td>
						 {/if}					     	
					     <td style="text-align: center;line-height:59px;">
					  			<a href="PLATFORM_MAIN/config/loginwchatconfig">配置</a>					  		  
					  	</td>
					</tr>
					<tr>
					     <td>
					         <div class="table-logo"><img src="__PUBLIC__admin/images/qq.png"></div>
					         <span class="table-pay">qq登录</span>
					         <span class="table-desc"></span> 
					     </td>
					     {if condition="$qq_config.is_use eq 1"}
					     	<td style="text-align: center;line-height:59px;"><a href="javascript:;" class="pay-start" status =1 onclick="set_status('QQLOGIN', this)"><img src="__ROOT__/public/admin/images/start.png" /></a></td>
					     {else/}
					     	<td style="text-align: center;line-height:59px;"><a href="javascript:;" class="pay-close" status =0 onclick="set_status('QQLOGIN', this)"><img src="__ROOT__/public/admin/images/close.png" /></a></td>
						 {/if}					     	
					     <td style="text-align: center;line-height:59px;">
					  			<a href="PLATFORM_MAIN/config/loginqqsetconfig">配置</a>
				  		  
					  	</td>
					</tr>
			</tbody>
		</table>
	</div>
								
</div>
<script>

function set_status(type,event){
	//alert(type);
	var status = $(event).attr('status');
	//alert(status);
	if(status == 1)
	{
		var change_status = 0;
	}
	else{
		var change_status = 1;
	}
	$.ajax({
		type : "post",
		url : "PLATFORM_MAIN/config/setstatus",
		data : {
			'is_use' : change_status,
			'type' : type
		},
		async : true,
		success : function(data) {
			//alert(JSON.stringify(data));
			if (data["code"] > 0) {
				if(status == 1)
				{
					$(event).attr('status', 0);
					$(event).find('img').attr('src', '__ROOT__/public/admin/images/close.png');
					
				}else{
					$(event).attr('status', 1);
					$(event).find('img').attr('src', '__ROOT__/public/admin/images/start.png');
				}
				showMessage('success', data["message"]);
			}else{
				showMessage('error', data["message"]);
			}	
			flag = false;
		}
	});
   

}


</script>
{/block}